<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns:MSHelp="http://www.microsoft.com/MSHelp/" lang="en-us" xml:lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="DC.Type" content="reference">
<meta name="DC.Title" content="scalable_allocator Template Class">
<meta name="DC.subject" content="allocator, scalable_allocator">
<meta name="keywords" content="allocator, scalable_allocator">
<meta name="DC.Relation" scheme="URI" content="../../reference/memory_allocation.htm">
<meta name="DC.Relation" scheme="URI" content="../../reference/memory_allocation/scalable_allocator_cls/c_interface_to_scalable_allocator.htm">
<meta name="DC.Relation" scheme="URI" content="allocator_concept.htm">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="scalable_allocator_cls">
<meta name="DC.Language" content="en-US">
<link rel="stylesheet" type="text/css" href="../../intel_css_styles.css">
<title>scalable_allocator Template Class</title>
</head>
<body id="scalable_allocator_cls">
 <!-- ==============(Start:NavScript)================= -->
 <script src="..\..\NavScript.js" language="JavaScript1.2" type="text/javascript"></script>
 <script language="JavaScript1.2" type="text/javascript">WriteNavLink(2);</script>
 <!-- ==============(End:NavScript)================= -->
<a name="scalable_allocator_cls"><!-- --></a>


    <h1 class="topictitle1">scalable_allocator Template Class</h1>

    
<div>
        <div class="section"><h2 class="sectiontitle">Summary</h2>
            
            <p>Template class for scalable memory allocation.</p>

            </div>
<div class="section"><h2 class="sectiontitle">Syntax</h2>
            <pre>template&lt;typename T&gt; class scalable_allocator;</pre>
            </div>
<div class="section"><h2 class="sectiontitle">Header</h2>
            <pre>#include "tbb/scalable_allocator.h"</pre>
            </div>
<div class="section"><h2 class="sectiontitle">Description</h2>
            <p>A <samp class="codeph">scalable_allocator</samp> allocates and frees memory
                in a way that scales with the number of processors. A
                    <samp class="codeph">scalable_allocator</samp> models the Allocator Concept.
                Using a <samp class="codeph">scalable_allocator</samp> in place of
                    <samp class="codeph">std::allocator</samp> may improve program performance. Memory
                allocated by a scalable_allocator should be freed by a
                    <samp class="codeph">scalable_allocator</samp>, not by a
                <samp class="codeph">std::allocator</samp>.</p>

            <div class="Note"><h3 class="NoteTipHead">
					Caution</h3><p>The <samp class="codeph">scalable_allocator</samp> requires that the tbb malloc library be available. If the library is missing, calls to the scalable allocator fail. In contrast, <samp class="codeph">tbb_allocator</samp> falls back on <samp class="codeph">malloc</samp> and free if the tbbmalloc library is missing. </p>
</div>
            </div>
<div class="section"><h2 class="sectiontitle">Members</h2>
            <p>See Allocator concept.</p>

            </div>
<div class="section"><h2 class="sectiontitle">Acknowledgement</h2>
            <p>The scalable memory allocator incorporates McRT technology developed by Intel's PSL CTG team.</p>
</div>

    </div>

    
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong>&nbsp;<a href="../../reference/memory_allocation.htm">Memory Allocation</a></div>
</div>
<div class="See Also">
<ul class="ullinks">
<li class="ulchildlink"><a href="../../reference/memory_allocation/scalable_allocator_cls/c_interface_to_scalable_allocator.htm">C Interface to Scalable Allocator</a><br>
</li>
</ul>

<h2>See Also</h2>
<div class="linklist">
<div><a href="allocator_concept.htm">Allocator Concept 
		  </a></div></div>
</div>
</body>
</html>
